

export const requset = <T>(params : UniApp.RequestOptions): Promise<T> => {
	return new Promise((resolve, reject) => {
		uni.request({
			...params,
			method: params.method || 'POST',
			timeout: params.timeout || 100000,
			header: {
				apiKey: '5osbQfOYebVFHmJnOMFTNoNNGLJM5kNc5glKmCHt9WqNYtnI5DWclyWpTGUDKkFM',
				secretKey: '0cYDUrll5rRayNGxG074hEzW5q5wy5HgC1roR2fQl2ExjDDbsU2cI2kO4yXjdGrx'
			},
			success: (res) => {
				console.log('res=====', res);
				resolve(res.data as T)
			},
			fail: err => {
				console.log('错误信息', err);
				reject(err)
			}
		});

	})
}
